home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / actionrp / nhplusx.bin / nhplusx / nhplusX / X11 / Install.X11 < prev    next >
Text File  |  1995-09-10  |  8KB  |  146 lines

  1.  
  2. This is a first cut at an X11 window port for NetHack.  X11 offers enormous
  3. potential for NetHack, little of which is realized here.  If you have ideas
  4. and extra time, feel free to send in improvements!
  5.  
  6. There are no explicit UNIX dependencies in this code, but we have only
  7. tested it under UNIX, using X11R4 or X11R5.  We have two reports that the
  8. code also works under DesqView/X on MS-DOS with djgpp, but you will have
  9. to add dependencies for the X code to that makefile before you can use it.
  10. Other X11R4+ platforms may work as well, with some tweaking likely.
  11. Follow WIN* in sys/unix/Makefile.src for compilation hints.
  12.  
  13. (If you try to compile it with X11R3 or earlier, you will get many errors,
  14. starting with complaints about XtPointer not being declared.  If you get
  15. around the compilation problems, you will still need a recent library of
  16. Athena Widgets to link against.  Once compiled, you can probably run it
  17. under an R3 X server, though.)
  18.  
  19. The reason this uses the Athena widget set is that the Athena widgets come
  20. free from MIT (like X11).  Unfortunately, the companies that resell X11
  21. (value subtracted er, added software; yea, yea, that's the ticket) usually
  22. discourage its use by either omitting the set or putting it on the
  23. "unsupported" portion of their tape.  If you do not have the Athena
  24. widgets, you may obtain them via anonymous ftp from export.lcs.mit.edu.
  25.  
  26. To use this code, define X11_GRAPHICS in include/config.h.  (You can comment
  27. out TTY_GRAPHICS or change DEFAULT_WINDOW_SYS if you want to, but there's
  28. little reason to do so.  The X11 version almost requires a config file
  29. for full effect, so you can just as well set windowtype there; also, you
  30. or someone else might just possibly be stuck in a situation where you can't
  31. use the X version -- over a non-blindingly-fast modem, say.)  Add $(WINX11SRC),
  32. $(WINX11OBJ), and $(WINX11LIB) to WINSRC, WINOBJ, and WINLIB respectively
  33. in src/Makefile.  This will give you an executable supporting both X11 and
  34. tty windowing.
  35.  
  36. If you are using Xauthority security, installing NetHack setuid may cause
  37. problems since the alternate id will probably not have permission to open
  38. your display.  NetHack will be just as happy setgid, but you will have to
  39. change the file permissions in the top Makefile before 'make install' to
  40. do that.
  41.  
  42. If you want special graphics symbols, you will also need to install one
  43. or both of the included X11 fonts and use the symbol mappings found in
  44. nethack.rc.  The fonts are found in nh10.bdf and ibm.bdf.  You first need
  45. to convert the bdf files to whatever form your X11 server recognizes
  46. (usually using a command called bdftosnf, or on Ultrix systems, bdftopcf).
  47. Then run mkfontdir on the directory containing your font files (you might
  48. want to copy them to GAMEDIR, from the top Makefile, after you've done
  49. "make install").  If these commands aren't familiar, talk to your local
  50. X11 guru and read the man pages.  Finally, add that directory to your
  51. font search path (e.g. xset fp+ GAMEDIR, setting GAMEDIR to the value of
  52. GAMEDIR in the top Makefile).  Alternatively, you (assuming you are a
  53. system administrator) can install the fonts in your standard X11 font
  54. directory.  If you do not install the fonts in the standard X11 font
  55. directory, all persons playing nethack must add that "xset fp+" command
  56. to their .xinitrc file, or whatever file they execute when starting X11.
  57. Adding the "xset" command to the nethack.sh is also an alternative, though
  58. it may clutter your X11 font search path after playing several games, so
  59. this method is not recommended.  See the note below for the alternative
  60. installation procedure for Sun's OpenWindows.
  61.  
  62. If your X11 include files and libraries are not installed in a standard
  63. place (i.e. /usr/include/X11 and /usr/lib respectively) you will need to
  64. prepend an appropriate -I<idirectory> parameter to CFLAGS and a
  65. -L<ldirectory> parameter to LFLAGS, setting <?directory> to the place to
  66. find the include and library files for X11.
  67.  
  68. Finally, you should also install the NetHack.ad file in the normal X11
  69. applications defaults directory.  Alternatively, each person may append
  70. the contents of this file to their .Xdefaults file.  A second
  71. alternative is copy NetHack.ad to GAMEDIR (from the top Makefile) and
  72. add a line to nethack.sh specifying this additional applications
  73. defaults directory:
  74.     XAPPLRESDIR=$HACKDIR; export XAPPLRESDIR
  75.  
  76. Three icon suggestions to the window manager are supported:  nh72, nh56,
  77. and nh32.  Data for them comes from the source files nh72icon, nh56icon,
  78. and nh32icon; they are compiled into the program via #includes in winX.c.
  79. Selection between them is controlled by the "icon" resource in NetHack.ad;
  80. the default is nh72.
  81.  
  82. Sorry, an Imakefile is not included.  Unlike many X11 programs, X11
  83. support is only a small, optional, part of nethack, and the Makefile is
  84. needed for systems that don't use X11.
  85.  
  86. Notes for Sun's OpenWindows:
  87.     1.    For OpenWindows 3.0 (NOT 2.x), define OPENWINBUG in include/unixconf.h.
  88.     The library bug from SunOS 4.1.x is apparently fixed in Solaris 2.x, 
  89.     so it is also unnecessary there.  (Defining it when unnecessary
  90.     causes the same problem being avoided when it is necessary. :-)
  91.  
  92.     2.  In addition to the changes suggested by the comments in src/Makefile,
  93.  
  94.     -- for OpenWindows 2.x and 3.0 (NOT 3.1) (i.e., versions for SunOS 4.x),
  95.        add -I/usr/openwin/include to CFLAGS, -L/usr/openwin/lib to LFLAGS,
  96.        and -lm to WINX11LIB in src/Makefile.
  97.  
  98.     -- for OpenWindows 3.1 (i.e., versions for Solaris 2.x), add
  99.        -I/usr/openwin/include to CFLAGS, -L/usr/openwin/lib -L/usr/ccs/lib
  100.        -R/usr/openwin/lib to LFLAGS, and -lsocket -lnsl -lm
  101.        to WINX11LIB in src/Makefile.
  102.  
  103.     (Naturally, if your OpenWindows is installed elsewhere, adapt the
  104.     openwin paths.)  This will allow you to create a game executable.
  105.  
  106.     3.    Run the fonts through convertfont and run bldfamily on the directory.
  107.     Now you must let your X server know where to find the fonts.  For a
  108.     personal installation, the simplest thing is to include the directory
  109.     of the fonts in the environment variable FONTPATH, as set in your
  110.     .profile or .login before starting the server.  For a multi-user
  111.     installation, you have the various "xset fp+" options outlined
  112.     above for standard X.
  113.  
  114.     4.  Something must still be done with the NetHack.ad file -- all three
  115.     of the possibilities mentioned for standard X11 should work.
  116.  
  117.  
  118. Notes for XFree86 - (on linux and BSD386 platforms)
  119.  
  120.     1.  Edit src/Makefile for linux/BSD386. Even though you use the 
  121.     Open Look Window manager, do not define OPENWINBUG.  Use the 
  122.     standard X11 object and library options.
  123.  
  124.     2.  Follow the standard installation directions defined above.
  125.  
  126. File                Description
  127. ---------    ---------------------------------------------------------------
  128. nethack.rc    - A sample configuration file for fonts nh10 and ibm.
  129. nh10.bdf    - A modified version of the 10x20 standard font.
  130. ibm.bdf        - A modified version of one of the ibm (8x14) nethack font.
  131.           Must be used in conjunction with NetHack.ad or nethack.rc.
  132. nh32icon    - A 32x32 icon bitmap for use with window managers.
  133. nh56icon    - A 56x56 icon bitmap for use with window managers.
  134. nh72icon    - A 72x72 icon bitmap for use with window managers.
  135. NetHack.ad    - A sample .Xdefaults for a color screen.
  136. ../../include/Window.h
  137. ../../include/WindowP.h
  138. Window.c    - A bare-bones widget that has 16 colors and a drawing canvas.
  139. ../../include/winX.h
  140.         - Defines for the X window-port.
  141. win*.c        - Code for the X window-port
  142. dialogs.c    - A better dialog widget.  Original code (modified slightly
  143.           by Dean Luick) distributed under the X copyright by Tim
  144.           Theisen.  This is from his Ghostview program (which is under
  145.           the GNU public license, v2 or higher).
  146.